/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trab01_so;

/**
 *
 * @author Leonardo
 */
import java.util.ArrayList;

public class MemoriaVirtual extends ArrayList<Pagina> {

    ArrayList<Pagina> paginas;
 
    public boolean hasPage(String addr){
        boolean a = false;
        for ( int i = 0 ; i < this.size(); i++)
        {
           if ( this.get(i).address.equalsIgnoreCase(addr))
               a = true;
        }

        return a;
    }
    
    public int getPageIdx(String addr){
        for (int i = 0; i < this.size(); i++){
            if (this.get(i).getAddress().equalsIgnoreCase(addr)){
                return i;
            }
        }
        return -1;
    }
}
